package com.cci.kangdao.ecjv.controller;

import com.cci.kangdao.dto.BaseResponse;
import com.cci.kangdao.dto.response.ECJVPagedResponse;
import com.cci.kangdao.ecjv.service.ECJVGraphicInformationService;
import com.cci.kangdao.utilTool.BeanUtils;
import com.cci.kangdao.utilTool.ParameterTool;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

/**
 * @author yinguili
 * @version 1.0
 * @description: TODO
 * @date 2022/8/24 15:41
 */
@RestController
public class ECJVGraphicInformationController {

    @Resource
    private ECJVGraphicInformationService ecjvGraphicInformationService;

    @RequestMapping(value = "invite/getGraphicInformation.aspx",method = RequestMethod.GET)
    public BaseResponse cdsFaultCodeSortedOptimizer(HttpServletRequest request, HttpServletResponse response) throws Exception {

        Map<String, Object> map = ParameterTool.getParameterRequest(request, true);
        PageInfo graphicInformation = ecjvGraphicInformationService.getGraphicInformation(map);
        ECJVPagedResponse convert = BeanUtils.convert(graphicInformation, ECJVPagedResponse.class);
        return BaseResponse.success(convert);
    }

}
